﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrintCLZLHB.aspx.cs" Inherits="IYAKASAPortal.Statistics.PrintCLZLHB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>成都弥荣科技发展有限公司--打印统计车辆种类(环保)</title>
<link rel="stylesheet" href="../support/tfNiceTable/tfNiceTable.css"/>
<style type="text/css">
    body{
        overflow-y:scroll;
    }
</style>
<script type="text/javascript" src="../support/tfNiceTable/tfNiceTable.js"></script>
<script type="text/javascript" src="../script/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
        function doAjaxShow() {
            document.getElementById("divNiceTableMessage").style.left = $(window).width / 2;// window.parent.document.getElementById("mainContentFrame").scrollWidth/2-200;
            document.getElementById("divNiceTableMessage").style.top = $(window).height / 2;//window.parent.document.getElementById("mainContentFrame").scrollHeight/2-15;

            document.getElementById("divNiceTableMessage").style.display = "block";
        }

        $(function () {
            startSum("cls", "lblCLS");
            startSum("hgs", "lblHGS");
            startDiv("lblHGS", "lblCLS", "lblHGL");
            startSum("bhgs", "lblBHGS");
            startDiv("lblBHGS", "lblCLS", "lblBHGL");
            startSum("yhgs", "lblYHGS");
            startDiv("lblYHGS", "lblCLS", "lblYHGL");
            startSum("fhgs", "lblFHGS");
            startDiv("lblFHGS", "lblCLS", "lblFHGL");

            function startSum(trId, lblId) {
                var sum = 0;
                $("td[id='" + trId + "']").each(function () {
                    sum += parseInt($(this).text());
                });
                $("#" + lblId).text(sum);
            }

            function startDiv(lblgs, lblzs, result) {
                var res = 0, resgl = 0;
                res = parseInt($("#" + lblgs).text()) / parseInt($("#" + lblzs).text());
                resgl = (res * 100).toFixed(2);
                $("#" + result).text(resgl);
            }
        })
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<input type="hidden" id="txtUniqueKey" name="txtUniqueKey" value="" />
<div id="divNiceTableMessage" class="tfNiceTableMessage" style="display:none;">正在处理...</div>
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="height:25px;">
<tr>
    <td class="main_title_left"></td>
    <td class="main_title_center">&nbsp;成都弥荣科技发展有限公司--车辆类型分类合格率汇总表(环保)</td>
    <td class="main_title_right"></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="mainWidth">
<tr>
    <td>
        <table class="table_without_border">
            <tr>
	            <td><img src="../support/tfNiceTable/images/tfNiceTable_Search.gif" alt="" />
                    开始时间:<asp:TextBox ID="txtStart" runat="server" onclick="InitData('#txtStart')"></asp:TextBox>
                    结束日期:
                    <asp:TextBox ID="txtEnd" runat="server" onclick="InitData('#txtEnd')"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="" CssClass="btnSearch" OnClientClick="doAjaxShow();" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnSearchAll" runat="server" Text="" CssClass="btnSearchAll" OnClientClick="doAjaxShow();" OnClick="btnSearchAll_Click"/>
                </td>
                <td align="right">
                   <asp:Button ID="btnPrint" runat="server" Text="" CssClass="btnPrintEnabled" OnClientClick="doAjaxShow();" OnClick="btnPrint_Click"/>   
                </td>
            </tr>
        </table>
        <table border="1" cellspacing="0" cellpadding="3" class="tfNiceTable">
        <thead>
        <tr class="noborder">
            <td colspan="11" align="center" style="border:none">
                <asp:Label ID="lblTistle" Font-Size="1.4em" Font-Bold="true" runat="server" Text="车辆类型分类合格率汇总表(环保)"></asp:Label>
            </td>
        </tr>
        <tr class="noborder">
            <td colspan="7" style="padding-left:25px;">
                <asp:Label ID="lblJGMC" runat="server" Font-Size="1.2em" Text="机动车安全技术检验机构名称:"></asp:Label></td>
            <td colspan="4">
                <asp:Label ID="lblTJ" runat="server" Font-Size="1.2em" Text="统计范围:"></asp:Label>
                <asp:Label ID="lblDate" runat="server" Font-Size="1.2em" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <%--class="tfNiceTable_head_style"--%>
             <td style="width:5%" rowspan="2" align="center">序号</td>
             <td style="width:20%" rowspan="2" align="center">车辆类型</td>
            <td style="width:40%" colspan="5" align="center">总检</td>
             <td style="width:20%" colspan="2" align="center">一次合格</td>
             <td style="width:20%" colspan="2" align="center">复检合格</td>
        </tr>
        <tr>
            <td style="width:8%" align="center">车辆数</td>
            <td style="width:8%" align="center">合格数</td>
            <td style="width:8%" align="center">合格率</td>
            <td style="width:8%" align="center">不合格数</td>
            <td style="width:8%" align="center">不合格率</td>
            <td style="width:8%" align="center">车辆数</td>
            <td style="width:8%" align="center">合格率</td>
            <td style="width:8%" align="center">车辆数</td>
            <td style="width:8%" align="center">合格率</td>
        </tr>
        </thead>
        <tbody>
        <asp:Repeater id="rptList" runat="server">
        <ItemTemplate>
        <tr style="cursor:pointer;">
            <td align="center"><%# DataBinder.Eval(Container.DataItem, "SeqNum")%></td>            
            <td align="center"><%# DataBinder.Eval(Container.DataItem, "CLZL")%></td>
            <td align="center" id="cls"><%# DataBinder.Eval(Container.DataItem, "CLZS")%></td>
            <td align="center" id="hgs"><%# getHGS(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="hgl"><%# getHGL(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="bhgs"><%# getBHGS(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="bhgl"><%# getBHGL(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="yhgs"><%# getYHGS(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="yhgl"><%# getYHGL(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="fhgs"><%# getFHGS(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
            <td align="center" id="fhgl"><%# getFHGL(DataBinder.Eval(Container.DataItem, "CLZLDH").ToString())%></td>
        </tr>
        </ItemTemplate>
        </asp:Repeater>
        </tbody>
        <tr>
            <td colspan="2" align="center">合计</td>
            <td align="center">
                <asp:Label ID="lblCLS" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblHGS" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblHGL" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblBHGS" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblBHGL" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblYHGS" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblYHGL" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblFHGS" runat="server" Text=""></asp:Label>
            </td>
            <td align="center">
                <asp:Label ID="lblFHGL" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    <br />
    </td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
<script type="text/javascript" src="../support/jedate/jedate.min.js"></script>
<script type="text/javascript" src="../script/jquery.validate.min.js"></script>
<script type="text/javascript">
    function InitData(oId) {
        jeDate({
            dateCell: oId,//isinitVal:true,
            format: "YYYY-MM-DD hh:mm:ss",
            isTime: true, //isClear:false,
            minDate: "2000-10-19 00:00:00",
            maxDate: "2099-11-8 00:00:00"
        });
    }

    jQuery(function () {
        jQuery.validator.methods.compareDate = function (value, element, param) {
            var startDate = jQuery(param).val();

            var date1 = new Date(Date.parse(startDate.replace("-", "/")));
            var date2 = new Date(Date.parse(value.replace("-", "/")));
            return date1 < date2;
        };

        jQuery("#form2").validate({
            focusInvalid: false,
            rules: {
                "txtStart": {
                    date: true
                },
                "txtEnd": {
                    date: true,
                    compareDate: "#txtStart"
                }
            },
            messages: {
                "txtStart": {
                    date: "时间格式错误!"
                },
                "txtEnd": {
                    date: "时间格式错误!",
                    compareDate: "结束日期必须大于开始日期!"
                }
            }
        });

    });
</script>